#ifndef SYSTEM_LOG_H
#define SYSTEM_LOG_H
#include <QDir>
#include <QFile>
#include <fstream>
#include <QTextStream>

#include "global_defines.h"

class system_log : public QObject
{
    Q_OBJECT
public:
    system_log(QString datapath,QObject *parent = nullptr);

    void newExcel(const QString &fileName);
    void freeExcel();
    void AppendSystemLog(const QString &action_record, const QString &details);
    void CompareData(SOFTWARESETTINGS oldsetting, SOFTWARESETTINGS newsetting);
    QString *sys_log_file;

public slots:
    void mouseclicked(const QString &s);
    void save_clicked();
    void save_settings_button_pushed(const QString &s);
    void save_settings_canceled();
    void save_as_clicked();
    void save_as_settings_button_pushed(const QString &s);
    void load_clicked();
    void load_settings_button_pushed(const QString &s);
    void load_settings_canceled();
    void reset_settings_button_pushed(const QString &s);
    void motor_test_button_pushed(const QString &s);
    void delete_file_button_pushed();
    void motor_PowerOn();
    void motor_PowerOff();
    void laser_PowerOn();
    void laser_PowerOff();
    void wiper_PowerOn();
    void wiper_PowerOff();
    void get_temperature_pushed();

private:
    QFile *file;
    QTextStream *textout;
    int row;


};

#endif // SYSTEM_LOG_H
